#include <vector>
#include<set>
#include <algorithm>

using namespace std;

class Solution {
public:
    vector<int> arraysIntersection(vector<int>& arr1, vector<int>& arr2, vector<int>& arr3) {

        vector<int> back;
        set<int> arr;

        set<int> ar1(arr1.begin(), arr1.end());
        arr1.assign(ar1.begin(), ar1.end());

        set<int> ar2(arr2.begin(), arr2.end());
        arr2.assign(ar2.begin(), ar2.end());

        set<int> ar3(arr3.begin(), arr3.end());
        arr3.assign(ar3.begin(), ar3.end());

        set_intersection(ar1.begin(),ar1.end(),ar2.begin(),ar2.end(),inserter(arr,arr.begin()));

        set_intersection(ar3.begin(),ar3.end(),arr.begin(),arr.end(),inserter(back,back.begin()));

        
        return back;

    }
};
int main()
{

}